package com.zxj.shop.admin.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zxj.shop.admin.entity.Member;
import com.zxj.shop.admin.entity.Orders;
import com.zxj.shop.admin.service.MemberService;
import com.zxj.shop.admin.service.OrdersService;
import com.zxj.shop.admin.shiro.vo.PageBean;
import com.zxj.shop.admin.shiro.vo.PageVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "会员管理")
@RestController
@RequestMapping("/api/admin/member")
public class MemberController {

    @Autowired
    MemberService memberService;

    @ApiOperation(value = "会员列表")
    @GetMapping("/list")
    public PageVO<Member> list(PageBean pageBean) {
        IPage<Member> logLoginPage = memberService.page(new Page<>(pageBean.getPage(), pageBean.getLimit()));
        return PageVO.pageVO(logLoginPage.getRecords(), logLoginPage.getTotal());
    }
}
